<?php
/**
 * Created by PhpStorm.
 * User: jksen
 * Date: 2018/1/18
 * Time: 下午5:38
 */

namespace app\common\Validate;

use think\Validate;

class WidgetVailidate extends Validate
{
    protected $rule = [
        ['widget_name', 'require|max:1', '控件名称不能为空最大长度不能超过20个字符'],
        ['field_name', 'require|max:20', '字段名称不能为空最大长度不能超过20个字符'],
        ['field_length', 'require|max:10', '字段长度不能为空最大长度不能超过10个字符'],
        ['field_type', 'require|max:10', '字段类型名称不能为空最大长度不能超过10个字符'],
        ['is_required', 'require|max:1', '必选项选项为必填项'],
        ['is_empty', 'require|max:1', '为空选项为必填项|'],
    ];

    protected $scene = [
        'add' => ['widget_name', 'field_name', 'field_length', 'field_type', 'is_required', 'is_empty'],
    ];
}